import throttle from 'lodash/throttle'
export default function(type, name, obj) {
  obj = obj || window
  const func = () => {
    obj.dispatchEvent(new CustomEvent(name))
  }
  obj.addEventListener(type, throttle(func, 150))
}
